package com.neusoft.elm.dao;

import com.neusoft.elm.po.DeliveryAddress;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface DeliveryAddressDao {

@Select("select * from deliveryAddress where userId=#{userId}")
     List<DeliveryAddress> listDeliveryAddressByUserId(String userId) throws Exception;
@Insert("insert into deliveryAddress values(null,#{contactName},#{contactSex},#{contactTel},#{address},#{userId})")
     int saveDeliveryAddress(DeliveryAddress deliveryAddress) throws Exception;
@Delete("delete from deliveryAddress where daId=#{daId}")
     int removeDeliveryAddress(Integer daId) throws Exception;
@Select("select * from deliveryAddress where daId=#{daid}")
     DeliveryAddress getDeliveryAddressById(Integer daId) throws Exception;
@Update("update deliveryAddress set contactName=#{contactName},contactSex=#{contactSex},contactTel=#{contactTel},address=#{address} where daId=#{daId}")
     int updateDeliveryAddress(DeliveryAddress deliveryAddress) throws Exception;
}
